package com.java2404.micro.order.openfeign;

import com.java2404.micro.common.dto.GoodsDTO;
import com.java2404.micro.common.entity.Merchant;
import com.java2404.micro.common.entity.PageBean;
import com.java2404.micro.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @User userlq
 * @Date 2025/1/7 15:18
 * @Classname MerchantService
 * @Description TODO
 */
@FeignClient(value = "micro-merchant") // 注册中心服务名
public interface MerchantService {

    /**
     * 根据商家id查询商家信息
     *
     * @param mid
     * @return
     */
    @GetMapping("/merchant/getMerchant/{mid}")
    Result<Merchant> getMerchant(@PathVariable("mid") int mid);

    /**
     * 查询商品列表
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("goods/ShowGoods")
    Result<PageBean<GoodsDTO>> ShowGoods(@RequestParam(value = "pageNum") Integer pageNum, @RequestParam(value = "pageSize") Integer pageSize);
}
